home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
utils
/
scrollsr.arc
/
scroll.src
Wrap
Internet Message Format
|
1988-08-22
|
16KB
From koreth@ssyx.ucsc.edu (Steven Grimm) Fri Aug 12 12:01:00 1988
Path: caen.engin.umich.edu!mailrus!uwmcsd1!ig!agate!saturn!ssyx!koreth
From: koreth@ssyx.ucsc.edu (Steven Grimm)
Newsgroups: comp.sources.atari.st
Subject: v01i070: scroll -- fast screen scroller
Keywords: GST-assembler
Message-ID: <4494@saturn.ucsc.edu>
Date: 12 Aug 88 16:01 GMT
Sender: usenet@saturn.ucsc.edu
Lines: 443
Approved: koreth@ssyx.ucsc.edu
Submitted-by: uunet!mcvax!philmds!leo (Leo de Wit)
Posting-number: Volume 1, Issue 70
Archive-name: scroll
The following program, when placed in the AUTO folder, speeds up scrolling
(BIOS output only). Difference is most noticeable with relative few chars
per line; speeds up full screen editors, 'more' utilities, etc.
For all resolutions; not for GEM, only for TOS.
The corresponding binary is sent to the moderator of comp.binaries.atari.st.
The program was assembled and linked with the assembler and linker from the
GST-C compiler.
For correspondence conceirning this program (bugs, questions etc.) try
L. J. M. de Wit
Nachtegaallaan 7
5731XP Mierlo
Holland
e-mail: ..!mcvax!philmds!leo
------------------------ s t a r t h e r e ---------------------------------
******************************************************************************
* *
* scroll.asm version 1.0 of 23 July 1988 (C) L.J.M. de Wit 1988 *
* *
* This software may be used and distributed freely if not used commercially *
* and the originator (me) is mentioned. *
* *
******************************************************************************
*
* NAME
* scroll - fast text scrolling
*
* SYNTAX
* scroll.prg
*
* DESCRIPTION
* Scroll provides for fast scrolling; this is achieved by using a 64K
* buffer for screen memory and changing the physical screen location therein.
* The actual changes take place at the receipt of certain escape codes or
* characters that would make the entire display scroll.
*
* Scroll should be in the AUTO folder as SCROLL.PRG so that it is
* installed memory resident when the system is loaded.
*
* DECISIONS
* The extra storage needed grabs a 33K from your free mem, unless
* the memory cannot be reserved adjacent to the original screen memory,
* in which case 65K is needed.
* The console output vector at 4a8 is used to trap the escape codes.
* Also the bios vector had to be changed (a pity);
* this is only needed to be able to load from AUTO folders:
* the con_state vector is reinitiated when the resolution changes
* The program must reside in the current drive's AUTO folder to be able
* to find itself.
module scroll
section s.ccode
* character codes
lf equ 10
vt equ 11
ff equ 12
cr equ 13
esc equ 27
* scrinfo offsets
maxcol equ 0
maxrow equ 2
bprow equ 4
scrad equ 10
col equ 16
row equ 18
flag equ 38
* system variables
v_bas_ad equ $44e
con_state equ $4a8
* GEMDOS & (X)BIOS stuff
gemdos equ 1
bios equ 13
xbios equ 14
ptermres equ $31
supexec equ 38
setexc equ 5
setscreen equ 5
physbase equ 2
setblock equ $4a
pexec equ $4b
* divers
bpaglen equ $100
textlen equ 12
datalen equ 20
bsslen equ 28
linea0 equ $a000
scrinit
move.l 4(sp),a3 * basepage start
move.l #bpaglen,d3 * base page length
add.l textlen(a3),d3 * + text length
add.l datalen(a3),d3 * + data length
add.l bsslen(a3),d3 * + bss length
add.l #256,d3 * + rounding length
move.w #physbase,-(sp)
trap #xbios
addq.l #2,sp
move.l d0,a4 * Start physical screen memory
dc.w linea0
suba.w #44,a0
lea.l scrinfo(pc),a1
move.l a0,(a1) * start screen info to scrinfo
move.l a0,a2 * and also a2
move.w maxrow(a2),d1
addq.l #1,d1
mulu.w bprow(a2),d1 * screen size into d1
lea.l 8(sp),a0
cmpa.l a4,a0
bne.s scrinstall * last location not start of phys. screen mem.
tst.b 128(a3)
bne.s scrinstall * Prog. had argument: called the second time
add.l d1,d3 * add a screen size
sub.l d3,a0 * this will be taken off current prog area
move.l a0,sp
suba.l a3,a0
move.l a0,-(sp)
move.l a3,-(sp)
move.w #0,-(sp)
move.w #setblock,-(sp)
trap #gemdos * Leaving just enough for next load of myself
lea.l 12(sp),sp
pea nullstr
pea argstr
pea progname
move.w #0,-(sp)
move.w #pexec,-(sp)
trap #gemdos * load & exec myself with a nonzero arglist
lea.l 12(sp),sp
clr.w -(sp)
trap #gemdos * finished
scrinstall
lea.l 8(sp),a0
cmpa.l a4,a0
bne.s notattop * current mem not adjacent to phys. screen mem.
attop
suba.l a3,a0
move.l a0,d3 * d3 : just all we've got
lea.l topbase(pc),a0
move.l a4,(a0) * current phys screen mem becomes top base
sub.l d1,a4
lea.l botbase(pc),a0 * and botbase a screen 'lower'
move.l a4,(a0)
bra.s endcalc
notattop
move.l a3,d0
add.l d3,d0
clr.b d0 * Adjust for 256 byte boundary
lea.l botbase(pc),a0
move.l d0,(a0) * address lowest screen
add.l d1,d0 * a screen 'higher'
lea.l topbase(pc),a0
move.l d0,(a0) * address highest screen
add.l d1,d3 * add a screen's length to mem needed
add.l d1,d3 * and another one
endcalc
pea setvect(pc)
move.w #supexec,-(sp)
trap #xbios * set new console output vector
addq.l #6,sp
pea newbios(pc)
move.w #$2d,-(sp)
move.w #setexc,-(sp)
trap #bios * Set new BIOS vector
addq.l #8,sp
lea.l oldbios(pc),a0
move.l d0,(a0) * Save old one
move.l topbase(pc),d0
move.w #-1,-(sp)
move.l d0,-(sp)
move.l d0,-(sp)
move.w #setscreen,-(sp)
trap #xbios * make highest screen current
lea.l 12(sp),sp
clr.w -(sp) * return value: 0 for success
move.l d3,-(sp) * # bytes to keep
move.w #ptermres,-(sp) * keep process
trap #gemdos * stops here...
* New bios routine; only sets con_state to point to newconsole if not already
* saving the old value.
newbios
lea.l newconsole(pc),a0
cmpa.l con_state,a0
beq.s newsame
bsr setvect * Set con_state if it was not newconsole
newsame
movea.l oldbios(pc),a0
jmp (a0)
* This is the routine that con_state will always point to, except
* when printing characters from within the routine itself.
newconsole
move.l cvsav(pc),con_state * restore original vector
move.w d1,-(sp) * save character to be printed on the stack
movea.l scrinfo(pc),a1
lea.l hadesc(pc),a0
tst.b (a0)
beq.s noesc * If previous char was not escape; else ...
sf.b (a0) * Reset escape flag
tst.w row(a1)
bne.s no_0row * If cursor not on row 0
cmp.w #'I',d1
bne.s not_i * If not ESC I
bsr scr_down * else scroll down
move.w #esc,d1
bsr charout * and print the ESC
move.w #'I',d1
bsr charout * and the I
bra newdone
not_i
cmp.w #'L',d1
bne.s not_l